package com.wmmb.dao;

import java.util.List;

import org.hibernate.SessionFactory;

public class GiveRuleDao extends BaseDao {
	private SessionFactory osessionFactory;

	public SessionFactory getOsessionFactory() {
		return osessionFactory;
	}

	public void setOsessionFactory(SessionFactory sessionFactory) {
		super.setSessionFactory(sessionFactory);
	}
	
	public Object getGiveRule(Long eaId){
		String hql = "FROM BGiveRule WHERE eaId = ? AND type = 1 AND state = 1";
		Object[] condition = new Object[]{eaId };
		List<Object> list = super.find(hql, condition);
		if (list.size() == 0) {
			return null;
		}
		return list.get(0);
	}
}
